package com.ccp.dev.system.service;


import com.ccp.dev.core.basic.api.ISysJobLog;
import com.ccp.dev.core.basic.api.ISysJobLogService;
import com.ccp.dev.core.basic.base.BaseService;
import com.ccp.dev.core.basic.web.query.QueryFilter;
import com.ccp.dev.system.dao.SysJobLogDao;
import com.ccp.dev.system.model.SysJobLog;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * 对象功能:SYS_JOBLOG Service类
 * @author :phl
 * 创建时间:2011-12-28 17:01:51
 */
@Service
public class SysJobLogService implements ISysJobLogService{
	@Resource
	private SysJobLogDao sysJobLogDao;
	
	@Override
	public void addLog(ISysJobLog jobLog) {
		sysJobLogDao.add((SysJobLog) jobLog);
	}

	@Override
	public ISysJobLog getJobLog(String jobName, String trigName,
			Date strStartTime, Date strEndTime, long runTime, String content,
			int state) {
		SysJobLog jobLog=new SysJobLog();
		jobLog.setJobName(jobName);
		jobLog.setTrigName(trigName);
		jobLog.setStartTime(strStartTime);
		jobLog.setEndTime(strEndTime);
		jobLog.setRunTime(runTime);
		jobLog.setContent(content);
		jobLog.setState(state);
		
		return jobLog;
	}

	public List<SysJobLog> queryJobLogListByJobName(QueryFilter queryFilter){
		return this.sysJobLogDao.queryJobLogListByJobName(queryFilter);
	}

	public int delByIdArray(String[] ids){
		return this.sysJobLogDao.delByIdArray(ids);
	}
}
